package cn.com.css.taxInspection.gt3.service.impl;

import cn.com.css.taxInspection.gt3.entity.JcAyxxDebugEntity;
import cn.com.css.taxInspection.util.TsBqUtils;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.css.taxInspection.gt3.mapper.JcAyxxDebugJgryMapper;
import cn.com.css.taxInspection.gt3.entity.JcAyxxDebugJgryEntity;
import cn.com.css.taxInspection.gt3.service.JcAyxxDebugJgryService;


@Service("jcAyxxDebugJgryService")
public class JcAyxxDebugJgryServiceImpl extends ServiceImpl<JcAyxxDebugJgryMapper, JcAyxxDebugJgryEntity> implements JcAyxxDebugJgryService {
    @Override
    public void saveByDebugtaxorg(String currentUserId, String swjgDm, String content,String jcayxxuuid,String jczcryDm,String jcxcryDm,String jcaybh) {
        JcAyxxDebugJgryEntity _jcayxxdebugjgry = this.getById(jcayxxuuid);
        if(TsBqUtils.isNull(_jcayxxdebugjgry)){
            JcAyxxDebugJgryEntity jcAyxxDebugJgryEntity = new JcAyxxDebugJgryEntity();
            jcAyxxDebugJgryEntity.setJcayxxuuid(jcayxxuuid);
            jcAyxxDebugJgryEntity.setCreateId(currentUserId);
            jcAyxxDebugJgryEntity.setSwjgDm(swjgDm);
            jcAyxxDebugJgryEntity.setContent(content);
            jcAyxxDebugJgryEntity.setJczcryDm(jczcryDm);
            jcAyxxDebugJgryEntity.setJcxcryDm(jcxcryDm);
            jcAyxxDebugJgryEntity.setJcaybh(jcaybh);
            this.save(jcAyxxDebugJgryEntity);
        }else{
            _jcayxxdebugjgry.setCreateId(currentUserId);
            _jcayxxdebugjgry.setSwjgDm(swjgDm);
            _jcayxxdebugjgry.setContent(content);
            _jcayxxdebugjgry.setJczcryDm(jczcryDm);
            _jcayxxdebugjgry.setJcxcryDm(jcxcryDm);
            _jcayxxdebugjgry.setJcaybh(jcaybh);
            this.updateById(_jcayxxdebugjgry);
        }
    }
}